def log(file, vmd):
    for i in vmd:
        if i == "keys":
            print("解析骨骼关键帧...")
            for a in vmd["keys"]:
                # print(type(a['bone_name']))
                write(file, a["bone_name"])
                write(file, "frames" + str(a["frames"]))
                write(file, "translation" + str(a["translation"]))
                write(file, "rotation" + str(a["rotation"]))
                write(file, "curve" + str(a["curve"]))
        if i == "morph_keys":
            print("解析表情...")
            for a in vmd["morph_keys"]:
                write(file, "表情" + str(a["morph_name"]))
                write(file, "关键帧时间" + str(a["frame_time"]))
                write(file, "权重" + str(a["weight"]))
        if i == "cam_keys":
            print("解析镜头数据...")
            if vmd["cam_keys"] == 0:
                write(file,"没有镜头关键帧,指针位置"+str(file.tell()))
                pass
            else:
                for a in vmd["cam_keys"]:
                    # print(a)
                    write(file, "镜头时间", str(a["frame_time"]))
                    write(file, "镜头距离", str(a["distance"]))
        if i=="light_keys":
            if vmd["cam_keys"] == 0:
                write(file,"没有光线关键帧,指针位置"+str(file.tell()))
                write(file,"文件所有数据解析完毕,指针位置"+str(file.tell()))
                pass
            else:
                for a in vmd["cam_keys"]:
                    # print(a)
                    write(file, "光线时间", str(a["frame_time"]))
                    write(file, "光线距离", str(a["distance"]))

def write(file, data):
    file.write(data + "\n")
